import React from 'react';
import {WeaFormItem, WeaSelect} from 'ecCom';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

// 新闻模板
class ENewsMould extends React.Component {
    state = {
        value: this.props.value
    };

    render() {
        return (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@51ng18`} label={getLabel(23088, '新闻模板')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@jjo5m7`}
                    options={
                        this.props.options.map((item) => {
                            return {key: item.key, selected: false, showname: item.value};
                        })
                    }
                    value={this.state.value}
                    style={{width: '100px'}}
                    onChange={value => {
                        this.setState({value: value});
                    }}
                />
            </WeaFormItem>
        );
    }

    getSaveValues() {
        return this.state.value;
    }
}

export default ENewsMould;
